home *** CD-ROM | disk | FTP | other *** search
/ Programming Sound Cards / Programming Sound Cards.iso / sound_19 / notes.c < prev    next >
Text File  |  1995-01-01  |  1KB  |  119 lines

  1. #define FREQ 1193180.0
  2.  
  3. double pitch[95] = {
  4.     18.35,
  5.     19.45,
  6.     20.60,
  7.     21.83,
  8.     23.12,
  9.     24.50,
  10.     25.96,
  11.     27.50,
  12.     29.14,
  13.     30.87,
  14.     32.70,
  15.     34.65,
  16.     36.71,
  17.     38.89,
  18.     41.20,
  19.     43.65,
  20.     46.25,
  21.     49.00,
  22.     51.91,
  23.     55.00,
  24.     58.27,
  25.     61.74,
  26.     65.41,
  27.     69.30,
  28.     73.42,
  29.     77.78,
  30.     82.41,
  31.     87.31,
  32.     92.50,
  33.     98.00,
  34.    103.83,
  35.    110.00,
  36.    116.54,
  37.    123.47,
  38.    130.81,
  39.    138.59,
  40.    146.83,
  41.    155.56,
  42.    164.81,
  43.    174.61,
  44.    185.00,
  45.    196.00,
  46.    207.65,
  47.    220.00,
  48.    233.08,
  49.    246.94,
  50.    261.63,
  51.    277.18,
  52.    293.66,
  53.    311.13,
  54.    329.63,
  55.    349.23,
  56.    369.99,
  57.    392.00,
  58.    415.30,
  59.    440.00,
  60.    466.16,
  61.    493.88,
  62.    523.25,
  63.    554.37,
  64.    587.33,
  65.    622.25,
  66.    659.26,
  67.    698.46,
  68.    739.99,
  69.    783.99,
  70.    830.61,
  71.    880.00,
  72.    932.33,
  73.    987.77,
  74.   1046.50,
  75.   1108.73,
  76.   1174.66,
  77.   1244.51,
  78.   1328.51,
  79.   1396.91,
  80.   1479.98,
  81.   1567.98,
  82.   1661.22,
  83.   1760.00,
  84.   1864.66,
  85.   1975.53,
  86.   2093.00,
  87.   2217.46,
  88.   2349.32,
  89.   2489.02,
  90.   2637.02,
  91.   2793.83,
  92.   2959.96,
  93.   3135.96,
  94.   3322.44,
  95.   3520.00,
  96.   3729.31,
  97.   3951.07,
  98.   4186.01 };
  99.  
  100. void beep( unsigned int, unsigned int );
  101.  
  102. void play( note )
  103. int note;
  104. {
  105.     beep( FREQ/pitch[note], 2 );
  106. }
  107.  
  108. #ifdef TEST
  109.  
  110. void main()
  111. {
  112. int note;
  113.  
  114.     for (note = 0; note < 95; note++ )
  115.         play( note );
  116. }
  117.  
  118. #endif /* TEST */
  119.